package by.siarhei.java.tij.reusing.exercises.ex15;

import by.siarhei.java.tij.reusing.exercises.ex15.pkg.Insider;

/**
 * @author Siarhei Shchahratsou <s.siarhei@gmail.com>
 * @since 16.03.14
 */
public class Excercise15 {
    public static void main(String[] args) {
        checkProtectedOutsidePackage();
        checkProtectedOnInheritance();
    }

    private static void checkProtectedOutsidePackage() {
        Insider insider = new Insider();

        //can't compile
        //java: aMethod() has protected access in by.siarhei.java.tij.reusing.exercises.ex15.pkg.Insider
        //insider.aMethod();
    }

    private static void checkProtectedOnInheritance() {
        Outsider outsider = new Outsider();
        outsider.doAction();
    }
}
